SECONDS_IN_DAY = 60 * 60 * 24
DAYS_IN_PAY = 14

d_day = Time.mktime(2009, 3, 30, 0, 0, 0, 0)
today = Time.new()

diff_in_sec = d_day - today
diff_in_days = (diff_in_sec / SECONDS_IN_DAY).to_i
days_to_wait = (DAYS_IN_PAY - diff_in_days) % DAYS_IN_PAY
puts days_to_wait
